#include <stdio.h>
#include <stdlib.h>

int main(int argc,char** argv){
	if(argc!=3){
		printf("usage:%s fromfile tofile",argv[0]);
		exit(-1);
	}
	FILE* fp=fopen(argv[1],"r");
	FILE* fpto=fopen(argv[2],"w+");
	if(!fp || !fpto){
		printf("open file error");
		exit(-1);
	}
	char ch;
	while( (ch=fgetc(fp)) !=EOF){
		putc(ch,fpto);
	}
	fclose(fp);
	fclose(fpto);
}
